package cn.yuyin.utile;

import java.io.IOException;
import java.util.Vector;
import javax.microedition.lcdui.Image;
import cn.yuyin.main.Main;

public class JiaoYouMessageTip extends Thread{
	public static boolean isTip = false;
	public static boolean isstart = false;
	public static String FriendID = "0";
	public static Vector vector = new Vector(3);
	public JiaoYouMessageTip(){
		try {
			if(Main.superPage.item!=null){
				Main.superPage.item.superPage.image = Image.createImage("/menupTip.png");
			}else{
				Main.superPage.image = Image.createImage("/menupTip.png");
			}			
		} catch (IOException e) {
			e.printStackTrace();
		}
		isTip = true;
	}
	
	public static void close(){		
		if(vector.size()!=0){
			FriendID = ""+vector.firstElement();
			try {
				if(Main.superPage.item!=null){
					Main.superPage.item.superPage.image = Image.createImage("/menupTip.png");
				}else{
					Main.superPage.image = Image.createImage("/menupTip.png");
				}			
			} catch (IOException e) {
				e.printStackTrace();
			}
		}else{
			isTip = false;
			isstart =false;
		}
	}
	
	public void run() {
		while (isTip) {
			isstart = !isstart;
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			Main.mainCanvas.repaint((Main.WIDTH-18)/2, Main.HEIGHT-Main.BottomHeight,(Main.WIDTH-18)/2+18, Main.HEIGHT-Main.BottomHeight+18);
		}
	}
	
}
